package GUI_Data.User;

import lombok.Data;

import java.awt.*;
/**
 * The class contain all the dimension information.
 *
 * @author Xiaorun Wang
 * @author Chunxi Lin
 * @author Yibai Jiang
 */
@Data
public class SetDimension {
    private  double screenWidth;
    private  double screenHeight;

    private Dimension headerDimension;
    private Dimension sidebarDimension;
    private Dimension footingDimension;
    private Dimension centerDimension;
    private Dimension keyboardDimension;
    private Dimension inputDimension;
    private Dimension keyDimension;
    private Dimension scanConfirmDimension;
    private Dimension seatChooseDimension;
    private Dimension buttonListInSeatChooseDimension;
    private Dimension buttonListInMealChooseDimension;
    private Dimension eachMealPanelDimension;
    private Dimension mealPictureDimension;
    private Dimension mealChooseDimension;
    private Dimension buttonPanelInPayHeightDimension;
    private Dimension payInfoDimension;
    private Dimension payTableDimension;
    private Dimension displayDimension;
    private Dimension nav_Exit;
    private Dimension nav;
    private Dimension side_button;
    private Dimension printTableDimension;

    /**
     * The generator of the SetDimension.
     */
    public SetDimension(){
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setScreenWidth(screenSize.getWidth());
        setScreenHeight(screenSize.getHeight());

        int headerHeight = (int)(screenHeight * 0.15);
        int headerWidth = (int)screenWidth;
        int sidebarHeight = (int)(screenHeight * 0.75);
        int sidebarWidth = (int)(screenWidth * 0.1);
        int footingHeight = (int)(screenHeight * 0.1);
        int footingWidth = (int)screenWidth;
        int centerHeight = (int)(screenHeight * 0.75);
        int centerWidth = (int)(screenWidth * 0.8);
        int keyboardWidth = (int)(screenWidth * 0.06);
        int keyboardHeight = (int)(screenHeight * 0.06);
        int inputWidth = (int)(screenWidth * 0.6);
        int inputHeight = (int)(screenHeight * 0.1);
        int keyWidth = (int)(screenWidth * 0.6);
        int keyHeight = (int)(screenHeight * 0.18);
        int scanWidth = (int)(screenWidth * 0.2);
        int scanHeight = (int)(screenWidth * 0.2);
        int seatChooseHeight = (int)(screenHeight * 0.75);
        int seatChooseWidth = (int)(screenWidth * 0.6);
        int buttonListInSeatChooseWidth = (int)(screenWidth * 0.2);
        int mealPanelWidth = (int)(screenWidth * 0.6);
        int mealPanelHeightSingle = (int)(screenHeight * 0.2);
        int mealPictureWidth = (int)(screenWidth*0.2);
        int mealPictureHeight = (int) (screenHeight*0.16);
        int buttonPanelInPayWidth = (int)(screenWidth * 0.8);
        int buttonPanelInPayHeight = (int)(screenHeight * 0.16);
        int payInfoHeight =  (int)(screenHeight * 0.65);
        int payTableHeight = (int)(screenHeight * 0.55);
        int displayHeight = (int)(screenHeight * 0.75);
        int displayWidth = (int)(screenWidth * 0.2);
        int navButtonHeight = (int)(screenHeight * 0.12);
        int navButtonWidth = (int)(screenWidth * 0.12);
        int navExitButtonHeight = (int)(screenHeight * 0.12);
        int navExitButtonWidth = (int)(screenWidth * 0.17);
        int sideButtonHeight = (int)(screenHeight * 0.12);
        int sideButtonWidth = (int)(screenWidth * 0.15);
        int printTableWidth = (int)(screenWidth * 0.15);
        int printTableHeight = (int)(screenWidth * 0.5);

        setNav(new Dimension(navButtonWidth,navButtonHeight));
        setNav_Exit(new Dimension(navExitButtonWidth,navExitButtonHeight));
        setSide_button(new Dimension(sideButtonWidth,sideButtonHeight));
        setHeaderDimension(new Dimension(headerWidth,headerHeight));
        setSidebarDimension(new Dimension(sidebarWidth,sidebarHeight));
        setFootingDimension(new Dimension(footingWidth,footingHeight));
        setCenterDimension( new Dimension(centerWidth,centerHeight));
        setKeyboardDimension(new Dimension(keyboardWidth, keyboardHeight));
        setInputDimension(new Dimension(inputWidth, inputHeight));
        setKeyDimension(new Dimension(keyWidth, keyHeight));
        setScanConfirmDimension(new Dimension(scanWidth, scanHeight));
        setSeatChooseDimension(new Dimension(seatChooseWidth,seatChooseHeight));
        setButtonListInSeatChooseDimension(new Dimension(buttonListInSeatChooseWidth,seatChooseHeight));
        setButtonListInMealChooseDimension(buttonListInSeatChooseDimension);
        setEachMealPanelDimension(new Dimension(mealPanelWidth, mealPanelHeightSingle));
        setMealPictureDimension(new Dimension(mealPictureWidth,mealPictureHeight));
        setMealChooseDimension(seatChooseDimension);
        setButtonPanelInPayHeightDimension(new Dimension(buttonPanelInPayWidth,buttonPanelInPayHeight));
        setPayInfoDimension(new Dimension(centerWidth, payInfoHeight));
        setPayTableDimension(new Dimension(centerWidth,payTableHeight));
        setDisplayDimension(new Dimension(displayWidth,displayHeight));
        setPrintTableDimension(new Dimension(printTableWidth,printTableHeight));
    }
}
